<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <!-- ejs的写法 -->
  <% let a=3 %>
    <h2>
      <%=username%>
    </h2>
    <h2>
      <%=products%>
    </h2>

    <p>a: <%=a%>
    </p>
    <% if (a>2) {
      %>
      <h3>很好</h3>
      <% } %>

        <h2>商品列表</h2>
        <ul>
          <% products.forEach(p=> {

            %>
            <li>
              <%=p.id%>-<%=p.name%>-<%=p.price%>
            </li>
            <% }) %>
        </ul>
</body>

</html>